﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using KerriganDataContract.Facture;
using KerriganDataContract;
using System.Diagnostics;

namespace KerriganService.DAC
{
    public class RecapFacturesDAC
    {
        public static RecapFacturesDC GetRecapFacturesByCustomer(int idCustomer) {
            RecapFacturesDC recap = new RecapFacturesDC();
            using (KerriganDBEntities db = new KerriganDBEntities())
            {
                try
                {
                    recap.SessionsToPay = SessionToPayDAC.CopyEntityToBo(db.SessionToPayByCustomer(idCustomer).ToList());
                    recap.Factures = FactureDAC.GetCustomerFacture(idCustomer);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }
            return recap;
        }


    }
}